package com.rf.richfitwheel.workflow.service;

import com.rf.richfitwheel.admin.sys.model.OrgHasParent;
import com.rf.richfitwheel.admin.sys.vo.UserVO;
import com.rf.richfitwheel.workflow.model.WfStationProcess;
import com.rf.richfitwheel.workflow.model.WfStationProcessOrder;
import com.rf.richfitwheel.workflow.model.WfStationProcessParPub;

import java.util.List;

/**
 * 岗位流程
 *
 * @author zhanglu
 * @email zhanglu2@cnpc.com.cn
 * @date 2021-07-22 13:57:22
 */
public interface WfStationProcessService {

    WfStationProcess selectByOrgCodeAndFolderCode(String orgCode, String folderCode);

    void saveAndPublishWfStationProcess(String dataForm, UserVO userVO) throws Exception;

    List<WfStationProcess> selectByModuleTypeAndOrgCode(String moduleType, String orgCode);
    
    /**
     * 获取单独为下级设置的参与条件
     * @param stationProcessId 岗位流程id
     * @return 参与条件列表
     */
    List<WfStationProcessParPub> getWfStationProcessParPubByStationProcessId(String stationProcessId);
    
    /**
     * 通过当前机构编码查询上级给设置的流程岗位,上级没设置或不参与的继续向上查找直至顶级
     * @param orgHasParent 当前机构
     * @param folderCode 流程目录编码
     * @return 流程岗位配置
     */
    List<WfStationProcessOrder> getParentStationOrders(OrgHasParent orgHasParent, String folderCode);
}

